package com.chima.action;
import net.sf.json.JSONArray;
import net.sf.json.JsonConfig;
import org.apache.struts2.ServletActionContext;

import com.chima.domain.Employees;
import com.opensymphony.xwork2.ActionSupport;
public class PictrueAction extends ActionSupport{
	private boolean success=false ;
	
	
	public boolean isSuccess() {
		return success;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}
	public String execute() throws Exception{
			Employees  e =(Employees) ServletActionContext.getRequest().getSession().getAttribute("existEmployee");
			JsonConfig jsonConfig = new JsonConfig();
			String url=e.getPhotoUrl();
//			JSONArray jsonArray = JSONArray.fromObject(success,jsonConfig);
			JSONArray jsonArray1 = JSONArray.fromObject(url,jsonConfig);
//			String jsonString = "{"+jsonArray1.toString()+"}";
//		    String jsonString = "{success:"+jsonArray.toString()+",message:"+jsonArray1.toString()+"}";
			ServletActionContext.getResponse().setContentType("text/json;charset=utf-8");
			ServletActionContext.getResponse().getWriter().print(jsonArray1);
		return NONE;
		
	}
	

}
